<?php
require_once "admin/dbconnector.php";
$db = opendatabase();
?>

<style type="text/css">
<!--
.lista {
	width: 700px;
	margin-left: 45px;
	border: none;
}
.descricao {
	background-color: #ff3708;
	color: #fff;
	font-weight: bold;
	padding-left: 5px;
}
.composicao {
	font-size: 8pt;
	vertical-align: top;
	padding-left: 5px;
	color: #4D9D00;
}
.valor {
	width: 60px;
	text-align: center;
	vertical-align: middle;
	font-weight: bold;
}
.image_header {
	width: 700px;
	height: 100px;
	margin: 0px 0 10px 45px;
	overflow: hidden; 
	border-radius: 10px;
}
.image_title {
        width: 100%;
}
.titulo {
	margin-left: 45px;
	width: 700px;
}
.titulo h2 {
	font-size: 16pt;
	text-align: center;
}
-->
</style>

<div id="content_bg_2">
	<div>
		<div class="titulo"><h2>Pizzas Tradicionais</h2></div>
		<div class="image_header">
			<img class="image_title" src="images/tradicionais.jpg" alt="" />
		</div>
		
		<table class="lista">
			
		<?php
		$rs = mysql_query("SELECT * FROM produto WHERE tipo = 1 ORDER BY descricao");

		while ($pizza = mysql_fetch_array($rs)) {
			echo "
				<tr>
					<td class='descricao'>" . strtoupper($pizza["descricao"]) . "</td>
					<td class='valor'>R$ " . number_format($pizza["valor"]/100,2,',','.') . "</td>
					<td><a href='adicionar_pedido.php?pid=" . base64_encode($pizza["id"]) ."'>Adicionar</a></td>
				</tr>
				<tr>
					<td class='composicao'>" . strtoupper($pizza["composicao"]) . "</td>
				</tr>
			";
		}
		?>
		</table>
	</div>

	<div>
		<div class="titulo"><h2>Pizzas Especiais</h2></div>
		<div class="image_header">
			<img class="image_title" src="images/especiais.jpg" alt="" />
		</div>
		
		<table class="lista">
			
		<?php
		$rs = mysql_query("SELECT * FROM produto WHERE tipo = 2 ORDER BY descricao");

		while ($pizza = mysql_fetch_array($rs)) {
			echo "
				<tr>
					<td class='descricao'>" . strtoupper($pizza["descricao"]) . "</td>
					<td class='valor'>R$ " . number_format($pizza["valor"]/100,2,',','.') . "</td>
					<td><a href='adicionar_pedido.php?pid=" . base64_encode($pizza["id"]) ."'>Adicionar</a></td>
				</tr>
				<tr>
					<td class='composicao'>" . strtoupper($pizza["composicao"]) . "</td>
				</tr>
			";
		}
		?>
		</table>
	</div>

	<div>
		<div class="titulo"><h2>Pizzas Doces</h2></div>
		<div class="image_header">
			<img class="image_title" src="images/doces.jpg" alt="" />
		</div>
		
		<table class="lista">
			
		<?php
		$rs = mysql_query("SELECT * FROM produto WHERE tipo = 3 ORDER BY descricao");

		while ($pizza = mysql_fetch_array($rs)) {
			echo "
				<tr>
					<td class='descricao'>" . strtoupper($pizza["descricao"]) . "</td>
					<td class='valor'>R$ " . number_format($pizza["valor"]/100,2,',','.') . "</td>
					<td><a href='adicionar_pedido.php?pid=" . base64_encode($pizza["id"]) ."'>Adicionar</a></td>
				</tr>
				<tr>
					<td class='composicao'>" . strtoupper($pizza["composicao"]) . "</td>
				</tr>
			";
		}
		?>
		</table>
	</div>

	<div>
		<div class="titulo"><h2>Massas</h2></div>
		<div class="image_header">
			<img class="image_title" src="images/massas.jpg" alt="" />
		</div>
		
		<table class="lista">
			
		<?php
		$rs = mysql_query("SELECT * FROM produto WHERE tipo = 4 ORDER BY descricao");

		while ($pizza = mysql_fetch_array($rs)) {
			echo "
				<tr>
					<td class='descricao'>" . strtoupper($pizza["descricao"]) . "</td>
					<td class='valor'>R$ " . number_format($pizza["valor"]/100,2,',','.') . "</td>
					<td><a href='adicionar_pedido.php?pid=" . base64_encode($pizza["id"]) ."'>Adicionar</a></td>
				</tr>
				<tr>
					<td class='composicao'>" . strtoupper($pizza["composicao"]) . "</td>
				</tr>
			";
		}
		?>
		</table>
	</div>

	<div>
		<div class="titulo"><h2>Sobremesas</h2></div>
		<div class="image_header">
			<img class="image_title" src="images/tradicionais.jpg" alt="" />
		</div>
		
		<table class="lista">
			
		<?php
		$rs = mysql_query("SELECT * FROM produto WHERE tipo = 5 ORDER BY descricao");

		while ($pizza = mysql_fetch_array($rs)) {
			echo "
				<tr>
					<td class='descricao'>" . strtoupper($pizza["descricao"]) . "</td>
					<td class='valor'>R$ " . number_format($pizza["valor"]/100,2,',','.') . "</td>
					<td><a href='adicionar_pedido.php?pid=" . base64_encode($pizza["id"]) ."'>Adicionar</a></td>
				</tr>
				<tr>
					<td class='composicao'>" . strtoupper($pizza["composicao"]) . "</td>
				</tr>
			";
		}
		?>
		</table>
	</div>
	
	<div>
		<div class="titulo"><h2>Bebidas</h2></div>
		<div class="image_header">
			<img class="image_title" src="images/tradicionais.jpg" alt="" />
		</div>
		
		<table class="lista">
			
		<?php
		$rs = mysql_query("SELECT * FROM produto WHERE tipo = 6 ORDER BY descricao");

		while ($pizza = mysql_fetch_array($rs)) {
			echo "
				<tr>
					<td class='descricao'>" . strtoupper($pizza["descricao"]) . "</td>
					<td class='valor'>R$ " . number_format($pizza["valor"]/100,2,',','.') . "</td>
					<td><a href='adicionar_pedido.php?pid=" . base64_encode($pizza["id"]) ."'>Adicionar</a></td>
				</tr>
				<tr>
					<td class='composicao'>" . strtoupper($pizza["composicao"]) . "</td>
				</tr>
			";
		}
		?>
		</table>
	</div>
</div>
